#!/usr/bin/env python3.10
# -*- encoding: utf-8 -*-
'''
@File    :   tags.py
@Time    :   2023/05/04 17:22:01
@Author  :   windstarry 
@Version :   1.0
'''
# here put the import lib
from tortoise import fields
from .base import BaseModel


class TagModel(BaseModel):
    """
    分类表
    name必须唯一
    """ 
    name = fields.CharField(max_length=50, unique=True)
    description = fields.TextField(default='', null=True,description="分类简介")
    
    class Meta:
        table_description = "分类表"
        table = "sys_tags"
        
    def __str__(self):
        return f"<{self.__class__.__name__} tag: {self.name}>"